package com.gouaixin.bee.beeframework2.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.gouaixin.bee.beeframework2.MyConfig;
import com.gouaixin.bee.beeframework2.service.MyService;
import com.gouaixin.bee.beeframework2.tool.PreferencesUtils;
import com.gouaixin.bee.beeframework2.tool.mLog;


/**
 * 作者：Fisher on 2015/5/8 14:06
 * 邮箱：630709658@qq.com
 * 座右铭:知识来自积累,经验源于总结
 */
public class MyPushReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        mLog.e("MyPushReceiver：当前时间=" + System.currentTimeMillis());


        boolean haveTuisong= PreferencesUtils.getBoolean(context, "haveTuisong", false);

        mLog.e("MyPushReceiver：haveTuisong=" + haveTuisong);

        if(haveTuisong==true){
            Log.e("test", "启动杀不死的服务:时间=" + MyConfig.Push_first);
            intent.setClass(context, MyService.class);
            context.startService(intent);
        }


    }
}
